import request from '@/axios'

interface BorrowPageParams {
  pageNo: number
  pageSize: number
  equipmentTypeId: number
  userId: number
  username: string
  userRealName: string
}

export const borrowListApi = (params: BorrowPageParams): Promise<IResponse<string[]>> => {
  return request.post({ url: '/api/borrow/list', params })
}

export const myBorrowsApi = (params: BorrowPageParams): Promise<IResponse<string[]>> => {
  return request.post({ url: '/api/borrow/myBorrows', params })
}

export const borrowApplyApi = (data: any): Promise<IResponse<string[]>> => {
  return request.post({ url: '/api/borrow/apply', data })
}

export const borrowApproveApi = (data: any): Promise<IResponse<string[]>> => {
  return request.post({ url: '/api/borrow/approve', data })
}

export const borrowRejectApi = (data: any): Promise<IResponse<string[]>> => {
  return request.post({ url: '/api/borrow/reject', data })
}

export const borrowReturnApi = (data: any): Promise<IResponse<string[]>> => {
  return request.post({ url: '/api/borrow/return', data })
}
